<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="<%= path %>/public/extjs/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="<%= path %>/public/css/icon.css" />
<script type="text/javascript" src="<%= path %>/public/extjs/adapter/ext/ext-base.js"></script> 
<script type="text/javascript" src="<%= path %>/public/extjs/ext-all.js"></script> 
</head>
<body topmargin="0">
<script type="text/javascript" >
Ext.BLANK_IMAGE_URL  =  '<%= path %>/public/extjs/resources/images/default/s.gif';
Ext.QuickTips.init();
var pathUrl = '<%= path %>'; //该变量必须存在
Ext.onReady(function() { 
	var loginForm =new Ext.form.FormPanel({
		bodyStyle:'padding:8px 8px 0',
		width: 265,
		height:90, 
		border : false, 
		fieldDefaults: 
		{
			msgTarget: 'side', 
			labelWidth:5 
		}, 
		defaultType: 'textfield', 
		defaults: { anchor: '100%' }, 
		items: [{ 
			fieldLabel: '帐号', 
			name: 'userName', 
			allowBlank:false, 
			blankText : '请输入帐号' },
			{ fieldLabel: '密码', 
			name: 'password', 
			inputType : 'password',
			allowBlank:false, 
			blankText : '请输入密码' }] 
		}); 
	var loginWindow = new Ext.Window({
		title : '登录', 
		width: 280,
		height:160, 
		items : [loginForm], 
		plain : true, 
		resizable : false, 
		closable:false,
		buttonAlign:'center',
		draggable:false, 
		buttons: [{ 
			text: '登录', 
			handler : function(){ 
				if (loginForm.form.isValid()){ 
					loginForm.form.submit({ 
						waitTitle : '请稍候', 
						waitMsg : '正在登录......', 
						url :pathUrl+'/login.do', 
						success : function(form, action) { 
							document.location.href=pathUrl+"/toframe.do";
						}, 
						failure: function(form, action) {
							if(action.result){ 
								Ext.Msg.alert('系统提示',action.result.message); 
							}else{ 
								loginForm.form.reset(); 
							} 
						} 
					}); 
				} 
			} 
		},
		{ 
			text: '重置',
			handler : function(){
				loginForm.form.reset(); 
			} 
		}] 
	}); 
	loginWindow.show(); 
});
</script>
</body>

</html>

